package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(name = "用户修改密码DTO")
@Data
public class UserUpdatePasswordDTO implements Serializable, RE {

    @NotNull(message = "主键不能为空")
    @Schema(description = "主键")
    private Long id;

    @Schema(description = "登录密码")
    @NotEmpty(message = "旧密码不能为空")
    @Pattern(regexp = PASSWORD_RE, message = PASSWORD_RE_MSG)
    private String oldPassword;

    @Schema(description = "登录密码")
    @NotEmpty(message = "新密码不能为空")
    @Pattern(regexp = PASSWORD_RE, message = PASSWORD_RE_MSG)
    private String newPassword;
}
